package xyz.dava.sync.fm.util;

import cn.hutool.core.io.FileUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

import java.io.File;
import java.nio.charset.StandardCharsets;

public class TestUtil {


    public static void main(String[] args) {
        String jsonStr = FileUtil.readString(new File("C:\\Users\\dava\\Desktop\\新建文件夹\\test.json"), StandardCharsets.ISO_8859_1);
        StringBuilder sb = new StringBuilder();
        for (JSONObject data : JSONUtil.parseArray(jsonStr).jsonIter()) {
            sb.append(data.get("OBJECTKEY") + "\r\n");
        }
        FileUtil.writeString(sb.toString(),
                new File("C:\\Users\\dava\\Desktop\\新建文件夹\\test2.txt"), "GB2312");
    }
}
